package com.fr.report.script.function;

import com.fr.report.script.Function;
import com.fr.report.script.Function.Type;
import com.fr.report.script.NormalFunction;
import com.fr.report.script.Primitive;

public class UPPER extends NormalFunction
{
  public Object run(Object[] paramArrayOfObject)
  {
    if (paramArrayOfObject.length < 1)
      return Primitive.ERROR_NAME;
    Object localObject = paramArrayOfObject[0];
    if (localObject != null)
      return "" + localObject.toUpperCase();
    return null;
  }

  public Function.Type getType()
  {
    return Function.TEXT;
  }

  public String getCN()
  {
    return "UPPER(text): 将文本中所有的字符转化为大写。\nText:需要转化为大写字符的文本，或是包含文本的单元格引用。\n示例:\nUPPER(\"notes\")等于“NOTES”。\n如果单元格E5的值为“Examples”，则UPPER(E5)等于“EXAMPLES”。";
  }

  public String getEN()
  {
    return "UPPER(text): Converts text to uppercase.\nText is the text you want converted to uppercase. Text can be a reference or text string.\n\nExample:\n   UPPER(\"notes\") = \"NOTES\"\n   If the value of cell E5 is \"Examples\", then UPPER(E5) = \"EXAMPLES\".";
  }
}